import { BaseData } from './base-data';

export class UploadServiceData {
    public static get uploadVersion() {
        return {
            input: {
                projectId: 'projectId',
                fileId: 'fileId',
                version: 'version',
                data: {
                    testData: 'testData',
                },
            },
            output: {
                config: {
                    headers: { Authorization: '', 'Content-Type': 'multipart/form-data' },
                    onUploadProgress: undefined,
                    params: {},
                    timeout: 60,
                },
                data: { testData: 'testData' },
                url: '/projects/projectId/file/fileId/versions/version',
            },
        };
    }
    public static get deleteAppFile() {
        return {
            input: {
                projectId: 'projectId',
                fileId: 'fileId',
                data: {
                    testData: 'testData',
                },
            },
            output: {
                config: {
                    data: undefined,
                    headers: { Authorization: '' },
                    onUploadProgress: undefined,
                    params: { testData: 'testData' },
                    timeout: 60,
                },
                url: '/projects/projectId/file/fileId/appData',
            },
        };
    }
    public static get uploadFilePut() {
        return {
            input: {
                file: 'file',
                data: {
                    action: 'action',
                    headers: { Authorization: 'Authorization' },
                    testData: 'testData',
                },
                cancelToken: BaseData.cancelToken,
                onUploadProgress: BaseData.onUploadProgress,
            },
            output: {
                config: {
                    cancelToken: BaseData.cancelToken,
                    headers: { Authorization: '' },
                    onUploadProgress: BaseData.onUploadProgress,
                    params: {},
                    timeout: 1800000000,
                },
                data: 'file',
                url: 'action',
            },
        };
    }
    public static get uploadFilePost() {
        return {
            input: {
                file: 'file',
                data: {
                    action: 'action',
                    headers: { Authorization: 'Authorization' },
                    testData: 'testData',
                },
                cancelToken: BaseData.cancelToken,
                onUploadProgress: BaseData.onUploadProgress,
            },
            output: {
                config: {
                    cancelToken: BaseData.cancelToken,
                    headers: { Authorization: '' },
                    onUploadProgress: BaseData.onUploadProgress,
                    params: {},
                    timeout: 1800000000,
                },
                data: 'file',
                url: 'action',
            },
        };
    }
    public static get uploadAppFilePost() {
        return {
            input: {
                projectId: 'projectId',
                file: 'file',
                data: {
                    action: 'action',
                    headers: { Authorization: 'Authorization' },
                    testData: 'testData',
                },
            },
            output: {
                config: {
                    headers: { Authorization: '' },
                    onUploadProgress: undefined,
                    params: {},
                    timeout: 1800000000,
                },
                data: 'file',
                url: 'action',
            },
        };
    }
    public static get uploadAppFile() {
        return {
            input: {
                projectId: 'projectId',
                appId: 'appId',
                folderId: 'folderId',
                fileName: 'fileName',
                data: {
                    testData: 'testData',
                },
            },
            output: {
                config: {
                    headers: { Authorization: '', 'Content-Type': 'application/octet-stream' },
                    onUploadProgress: undefined,
                    params: {},
                    timeout: 60,
                },
                data: '{"testData":"testData"}',
                url: '/projects/projectId/apps/appId/folder/folderId/file?fileName=fileName',
            },
        };
    }
    public static get getAppFile() {
        return {
            input: {
                projectId: 'projectId',
                fileId: 'fileId',
            },
            output: {
                config: { headers: { Authorization: '' }, onUploadProgress: undefined, params: {}, timeout: 60 },
                url: '/projects/projectId/file/fileId',
            },
        };
    }
    public static get getAppFileVersion() {
        return {
            input: {
                projectId: 'projectId',
                fileId: 'fileId',
                version: 'version',
            },
            output: {
                config: { headers: { Authorization: '' }, onUploadProgress: undefined, params: {}, timeout: 60 },
                url: '/projects/projectId/file/fileId/versions/version',
            },
        };
    }
    public static get getUploadUrl() {
        return {
            input: {
                testData: 'testData',
            },
            output: {
                config: {
                    headers: { Authorization: '' },
                    onUploadProgress: undefined,
                    params: { testData: 'testData' },
                    timeout: 60,
                },
                url: '/uploadUrl',
            },
        };
    }
    public static get getFolder() {
        return {
            input: {
                projectId: 'projectId',
                folderId: 'folderId',
            },
            output: {
                config: { headers: { Authorization: '' }, onUploadProgress: undefined, params: {}, timeout: 60 },
                url: '/projects/projectId/folder/folderId',
            },
        };
    }
    public static get initMultipart() {
        return {
            input: {
                projectId: 'projectId',
                cancelToken: BaseData.cancelToken,
            },
            output: {
                config: {
                    cancelToken: BaseData.cancelToken,
                    headers: { Authorization: '' },
                    onUploadProgress: undefined,
                    params: {},
                    timeout: 60,
                },
                data: undefined,
                url: '/projects/projectId/file/multipart/init',
            },
        };
    }
    public static get uploadMultipart() {
        return {
            input: {
                projectId: 'projectId',
                data: {
                    testData: 'testData',
                },
                params: {
                    testParams: 'testParams',
                },
                cancelToken: BaseData.cancelToken,
                onUploadProgress: BaseData.onUploadProgress,
            },
            output: {
                config: {
                    headers: { Authorization: '' },
                    params: { testParams: 'testParams' },
                    timeout: 1800000000,
                    cancelToken: BaseData.cancelToken,
                    onUploadProgress: BaseData.onUploadProgress,
                },
                data: { testData: 'testData' },
                url: '/projects/projectId/file/multipart/upload',
            },
        };
    }
    public static get completeMultipart() {
        return {
            input: {
                projectId: 'projectId',
                data: {
                    testData: 'testData',
                },
                requestTimeout: 60,
                cancelToken: BaseData.cancelToken,
            },
            output: {
                config: {
                    headers: { Authorization: '' },
                    cancelToken: BaseData.cancelToken,
                    onUploadProgress: undefined,
                    params: {},
                    timeout: 60000,
                },
                data: { testData: 'testData' },
                url: '/projects/projectId/file/multipart/complete',
            },
        };
    }

    public static get uploadFont() {
        return {
            input: {
                file: 'file',
                cancelToken: BaseData.cancelToken,
                onUploadProgress: BaseData.onUploadProgress,
            },
            output: {
                config: {
                    headers: { Authorization: '', 'Content-Type': 'multipart/form-data' },
                    params: {},
                    timeout: 1800000000,
                    cancelToken: BaseData.cancelToken,
                    onUploadProgress: BaseData.onUploadProgress,
                },
                data: 'file',
                url: '/fonts',
            },
        };
    }

    public static get initDeltaUpload() {
        return {
            input: {
                projectId: 'projectId',
                params: {
                    testParams: 'testParams',
                },
                cancelToken: BaseData.cancelToken,
            },
            output: {
                config: {
                    cancelToken: BaseData.cancelToken,
                    headers: { Authorization: '' },
                    onUploadProgress: undefined,
                    params: { testParams: 'testParams' },
                    timeout: 60,
                },
                data: undefined,
                url: '/projects/projectId/delta/init',
            },
        };
    }

    public static get getDeltaInfo() {
        return {
            input: {
                projectId: 'projectId',
                params: {
                    testParams: 'testParams',
                },
            },
            output: {
                config: {
                    headers: { Authorization: '' },
                    onUploadProgress: undefined,
                    params: { testParams: 'testParams' },
                    timeout: 60,
                },
                data: undefined,
                url: '/projects/projectId/file/delta',
            },
        };
    }

    public static get uploadDeltaPart() {
        return {
            input: {
                projectId: 'projectId',
                data: {
                    testData: 'testData',
                },
                params: {
                    testParams: 'testParams',
                },
                cancelToken: BaseData.cancelToken,
                onUploadProgress: BaseData.onUploadProgress,
            },
            output: {
                config: {
                    headers: { Authorization: '' },
                    params: { testParams: 'testParams' },
                    timeout: 1800000000,
                    cancelToken: BaseData.cancelToken,
                    onUploadProgress: BaseData.onUploadProgress,
                },
                data: { testData: 'testData' },
                url: '/projects/projectId/file/delta/upload',
            },
        };
    }

    public static get completeDeltaUpload() {
        return {
            input: {
                projectId: 'projectId',
                data: {
                    testData: 'testData',
                },
                params: {
                    testParams: 'testParams',
                },
                requestTimeout: 60,
                cancelToken: BaseData.cancelToken,
            },
            output: {
                config: {
                    headers: { Authorization: '', 'Content-Type': 'multipart/form-data' },
                    cancelToken: BaseData.cancelToken,
                    onUploadProgress: undefined,
                    params: { testParams: 'testParams' },
                    timeout: 60000,
                },
                data: { testData: 'testData' },
                url: '/projects/projectId/file/delta/complete',
            },
        };
    }
}
